/*

BlackRabbit - OpenSource IDE.
@author Edward Sarkisyan (edward.sarkisyan@gmail.com)
Use LGPL (http://www.gnu.org/copyleft/lesser.html)

*/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QDirModel>
#include <QModelIndex>
#include "widgets/rabbitmenu.h"
#include "globals.h"
/*!
  @author Edward Sarkisyan
  */
namespace Ui
{
    class MainWindow;
}

/*!
  @class MainWindow
  @brief Main Window class
   Main Window's UI some operations
  */
class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    /*! Constructor
      @arg parent Parent widget
    */
    MainWindow(QWidget *parent = 0);

    /*!
      Desctructor
      */
    ~MainWindow();

private:
    /*!
      Main Window's GUI
      */
    Ui::MainWindow *ui;
    QDirModel dirModel;
    /*!
      @sa void openFile(QString fileName)
      Opens file specified in @arg fileName
      @param fileName - file path must be opened
      */
    //void openFile(QString fileName);
private:
    /*!
      Sets default menu
    */
    void setMenus();
    /*!
      Main Menu container
      */
    QMenu *mainMenu;

private slots:
    /*!
      <b>SLOTS</b>
      */
    /*!
      Actiwated when user trigger "Extentions Menu" in "File" menu.
      */
    void on_rabbitMenuBttn_clicked();
    void on_actionExtentions_triggered();
    /*!
      Activated when user close some source containing tab.
      @param index - closed tab's index.
      */
    void on_openedFilesTabWidget_tabCloseRequested(int index);
    /*!
      Activated when clicking on projects file.
      @param index - index of this file in project countainer Tree Widget.
      */
    void openFile(QString fileName);
    /*!
      Activated when clicking on "+" button on main tab "Barev"
      */
    void on_addPluginToBarevTabBttn_clicked();
    /*!
      Activated when click'n on "Build" button
      @note Building process for different programming language doesn't simular.
      */
    void on_buildButton_clicked();
    /*!
      Activated when "File->Open->Open file" is triggered.
      */
    void on_action_Open_file_triggered();
    /*!
      Shows programm settings
      */
    void on_action_Settings_triggered();
    /*!
      Adding new independent file.
      */
    void on_action_New_file_triggered();
    void on_leftPluginAddBttn_clicked();
    void addPluginWidget();
    void on_action_Plugins_triggered();
    /*!
      Opens project specified in @arg projectFileName
      @param project fileName project's file path
      */
    void on_action_Open_Project_triggered(QString projectFileName = QString());
    /*!
      Creates new project when triggered "File->New project"
      */
    void on_action_New_Project_triggered();
};

#endif // MAINWINDOW_H
